package com.peng;

import java.awt.*;

public class Explode extends GameObject {
    public static final int WIDTH = ResourceManager.explodes[0].getWidth();
    public static final int HEIGHT = ResourceManager.explodes[0].getHeight();

    private boolean live = true;
    private int step = 0;

    public Explode() {

    }

    public Explode(int x, int y) {
        this.x = x;
        this.y = y;
    }

    @Override
    public void paint(Graphics g) {
        if (step >= ResourceManager.explodes.length) {
            step = 0;
            GameModel.getInstance().remove(this);
            return;
        }
        g.drawImage(ResourceManager.explodes[step++], x, y, null);
    }


    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }


    public boolean isLive() {
        return live;
    }

    public void setLive(boolean live) {
        this.live = live;
    }




}
